//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<XFlipFrame.h>
///	@path	~/src/appear/xwin/
///	@date	2008/11/18
///	@brief	.

#pragma once

#include "xeres.h"

#include "lib/math/vector.h"
#include "lib/math/matrix.h"
#include "lib/math/quad.h"

#include "appear/xwin/XAppFrame.h"

namespace xeres {

	/*! 
		\class	XFlipFrame
		\brief	3D space frame wrapper.
	*/
	class XFlipFrame : public XAppFrame
	{
	public:

		/// \ctor
		XFlipFrame( void );

		/// \ctor
		XFlipFrame( const Rect<int>& placement );

		/// \ctor
		XFlipFrame( const Pair<int>& size );

		/// \dtor
		virtual ~XFlipFrame( void );

		DECL_IOBJECT_CLASS_DYNAMIC( XFlipFrame , XAppFrame );

	public:

		/// \name XGui Component Attributes
		//@{

		/// \brief	Set position of component.
		virtual bool SetPosition( const Pair<int>& pos );

		/// \brief	Set size of component.
		virtual bool SetSize( const Pair<int>& size );

		/// \brief	Set parent component.
		virtual bool SetParent( RefWeak<IGuiForm> parent );

		/// \brief	Call when close window.
		virtual void OnClose( void );
		
		//@}

		/// \name Presentation Manipulation
		//@{

		/// \brief	Control how to composite the frame.
		virtual void OnComposite( RenderContext& rc , FrameComposition& fc );

		//@}

		/// \name Flip Frame Interface
		//@{

		/// \brief	Set flip transform.
		virtual void SetTransform( const Matrix<float>& xform );

		/// \brief	Get flip transform.
		virtual const Matrix<float>& GetFlipTransform( void );

		//@}

	private:

		//@ data
		Matrix<float>			m_transform;

		// flipping quad
		Quad					m_quad;

		// flipping status
		bool					m_flipping;
		bool					m_spare[3];
	};

} // namespace xeres
